package com.erp.common.enums;

import lombok.Getter;

@Getter
public enum DeleteEnum {
    NO(0, "未删除"),
    YES(1, "删除");

    private Integer code;

    private String desc;

    DeleteEnum (Integer code, String desc){
        this.code = code;
        this.desc = desc;
    }

    public static String getDescByCode(Integer code){
        if(code == null){
            return null;
        }
        DeleteEnum[] values = DeleteEnum.values();
        for (DeleteEnum value : values) {
            if(value.code.equals(code)){
                return value.desc;
            }
        }
        return null;
    }
}
